<?php 
//print_r($HttpResult);
if(FALSE){$HttpResult = new HttpResult();}

	  $HttpContentResult = $HttpResult->getHttpContentResult();
	  //Debug::print_r($HttpResult);
	  //$lang = Config::DEFAULT_LOCALE;
		$head = new HtmlHeader($HttpContentResult->getHeader());
		$head->addCSS('reset');
		$head->addCSS('print','', 'print');
		$head->addCSS('ie',  'css/ie', 'print',true);
		
		$head->addCSS('forum',"css/admin");		
		
		//<!-- PROGRAMACAO JS | JQUERY  -->
		$head->addJS(array('jquery', 'masked'));
		
    //MENU DROPDOWN
    $head->addJS('Menu principal','js/menu/ddsmoothmenu');
    $head->addCSS('Menu CSS','js/menu/ddsmoothmenu');
    
    //TINYMCE
    $head->addJS('tinymce','js/tinymce/jquery.tinymce');
    
    //FILEUPLOAD
    $head->addJS('so','js/uploadify/swfobject');
    $head->addJS('uploadify','js/uploadify/jquery.uploadify.v2.1.4.min');
    $head->addCSS('Upload CSS','js/uploadify/uploadify');
		       
		//SLIDER SHOW
		$head->addJS('cycle', 'js/cycle/jquery.cycle.min');
	
		//<!-- JQUERY UI  -->
		$head->addJS('UI', 'js/UI/js/jquery-ui-1.8.6.custom.min');
		$head->addCSS('UI','js/UI/css/smoothness/jquery-ui-1.8.6.custom');
		
     //SELECTMENU
    $head->addJS('selectmenu','js/UI/development-bundle/ui/jquery.ui.selectmenu');
    $head->addCSS('selectmenu CSS','js/UI/css/jquery.ui.selectmenu');
    
		//<!-- VTIP  -->
		$head->addJS('vtip', 'js/vtip/vtip');
		$head->addCSS('vtip', 'js/vtip/vtip');
		
		//<!-- TABLE SORTER -->
		$head->addJS('tablesorter', 'js/tablesorter/tablesorter');
		$head->addCSS('tablesorter', 'js/tablesorter/tablesorter');
    
    //<!-- PROGRAMACAO JS | JQUERY  -->
    $head->addJS(array('admin','admin_select', 'admin/artist/list'));
		
		$header_html = $head->show(TRUE);
$header_html = str_replace(array("democrart", "democrArt", "Democrart", "DemocrArt"), array("expressaoartistica", "Expressão Artística", "Expressão Artística", "Expressão Artística"), $header_html);
echo $header_html;
?>
 
<body>

<div id="main">
      <?php include "view/democrart/parts/admin/header.php" ?>
      
	  <div id="main_content" class="artist-list">
	  
	  <div id="msgBox"></div>
	  			
		 <div id="box_right">
		 	
		 	<ul id="search">
	  			<li><label for="product_search">Pesquisa:</label></li>
	  			<li><input type="text" id="product_search" name="search" /></li>
	  			<li><a href="<?php echo Config::getRootPath("admin/product/quadro/search.") ?>" onclick="this.href = this.href + $('#product_search').val();" class="btn" id="btnSearch">Ok</a></li>
	  		</ul>
		 	
			<h1>Listar Artistas</h1>

			<a style="float: right;margin: 10px 5px;" href="<?php echo Config::getRootPath("admin/artist/insert"); ?>" class="button">Novo Artista</a>
			<?php
			include_once("library/facil3/utils/Pagination.class.php");
			$Pagination = new Pagination($HttpContentResult->page, $HttpContentResult->limit_page, $HttpContentResult->count_total);
			$htmlPaginacao = $Pagination->getHtml();
			//echo $htmlPaginacao;
			?>
			<div style="clear:both">
				<table class="tablesorter">
					<thead>
						<tr>
							<th>Nome</th>
							<th>Quantidade de Quadros</th>
							<th>Ver Quadros</th>
							<th>Editar</th>
							<th>Excluir</th>
						</tr>
					</thead>
					<tbody>
					<?php foreach($HttpContentResult->arrayArtists as $artist){?>
						<tr id="user_<?php echo $artist->id ?>">
							<td><?php echo $artist->name ?></td>
							<td><?php echo $artist->count_product_model ?></td>
							<td><a href="<?php echo Config::getRootPath("admin/product/quadro/search.".$artist->name); ?>">ver quadros</a></td>
							<td class="ico"><a href="<?php echo Config::getRootPath("admin/artist/update/id.".$artist->id) ?>">
							<img id="edit1" src="<?php echo Config::getAsset("assets/img/icons/edit.jpg");?>" alt="Editar" title="" /></a></td>
							<td class="ico"><a class="del" name="user" id="<?php echo $artist->id ?>" href="<?php echo Config::getRootPath("admin/artist/delete/id.".$artist->id) ?>">
							<img id="del1" src="<?php echo Config::getAsset("assets/img/icons/delete.jpg");?>" alt="Excluir" title="" /></td>
						</tr>
					<?php }?>
					</tbody>
				</table>
			</div>
			
			<!-- COMECO PAGINACAO -->
			<div style="clear: both;"></div>
			<div id="model-pagination" style="text-align: center;padding: 20px 0px 20px 0px;">
			<?php 
				//Debug::print_r($HttpContentResult);
				echo $htmlPaginacao;
			?>
			
			</div>
		
		</div>
					
			
			<!-- FIM DO QUADRO -->
	
	</div>
	
</div>

</body>
</html>
